package com.pktechan.api.service.impl;

import com.pktechan.api.base.BaseMapper;
import com.pktechan.api.base.BaseServiceImpl;
import com.pktechan.api.dao.CustCarriageMapper;
import com.pktechan.api.entity.CustCarriage;
import com.pktechan.api.service.CustCarriageService;
import com.pktechan.api.vo.CustCarriageVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @program: cloudfloating
 * @description: 客户运费持仓服务层实现
 * @author: qx.zhang
 * @create: 2021-03-16 18:26
 **/
@Service("custCarriageService")
@Transactional
public class CustCarriageServiceImpl extends BaseServiceImpl<CustCarriage> implements CustCarriageService {

    @Autowired
    private CustCarriageMapper custCarriageMapper;

    /**
     * 由业务类实现
     *
     * @return
     */
    @Override
    public BaseMapper<CustCarriage> getBaseMapper() {
        return custCarriageMapper;
    }

    /**
     * 根据客户ID查询客户运费
     *
     * @param custId
     * @return
     */
    @Override
    public CustCarriage getByCustId(Integer custId) {
        return custCarriageMapper.getByCustId(custId);
    }

    /**
     * 运费中心
     * @param custId
     */
    @Override
    public CustCarriageVO getFreightCenter(Integer custId) {
       return custCarriageMapper.getFreightCenter(custId);
    }
}
